From 1fad6b049bddc2d8dab537f5f61204281232d9d9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 5 Oct 2014 17:29:32 -0400 Subject: [PATCH] GtkRange: Add a style class during dragging This will be used to identify a scrollbar is being dragged - we don't actually need the style class; another way to keep track of the dragging status would be ok too. --- gtk/gtkrange.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 496f9c1aba..62801c5f0b 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2257,6 +2257,9 @@ range_grab_add (GtkRange *range, MouseLocation location) { GtkRangePrivate *priv = range->priv; + GtkStyleContext *context; + + context = gtk_widget_get_style_context (GTK_WIDGET (range)); /* Don't perform any GDK/GTK+ grab here. Since a button * is down, there's an ongoing implicit grab on @@ -2267,6 +2270,8 @@ range_grab_add (GtkRange *range, if (gtk_range_update_mouse_location (range)) gtk_widget_queue_draw (GTK_WIDGET (range)); + + gtk_style_context_add_class (context, "dragging"); } static void @@ -2291,6 +2296,9 @@ range_grab_remove (GtkRange *range) { GtkRangePrivate *priv = range->priv; MouseLocation location; + GtkStyleContext *context; + + context = gtk_widget_get_style_context (GTK_WIDGET (range)); location = priv->grab_location; priv->grab_location = MOUSE_OUTSIDE; @@ -2301,6 +2309,8 @@ range_grab_remove (GtkRange *range) update_zoom_state (range, FALSE); range->priv->zoom_set = FALSE; + + gtk_style_context_remove_class (context, "dragging"); } static GtkScrollType -- 2.30.2